/**
 * 
 */
package com.demo2do.strawberry.entity.startup.activity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Type;

import com.demo2do.strawberry.entity.investor.Investor;
import com.demo2do.strawberry.entity.startup.Startup;
import com.demo2do.strawberry.entity.user.profile.Profile;

/**
 * @author Downpour
 */
@Entity
@Table(name = "startup_discussion")
public class Discussion {
	
	@Id
	@GeneratedValue
	private Long id;
	
	@Type(type = "text")
	private String content;
	
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	private Profile profile;
	
	private Date createTime;
	
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	private Startup startup;
	
	@Transient
	private Investor investor;
	
	/**
	 * The default constructor
	 */
	public Discussion() {
		
	}

	public Discussion initialize(Profile profile, Startup startup) {

		this.profile = profile;
		this.startup = startup;
		this.createTime = new Date();
		
		return this;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @return
	 */
	public Profile getProfile() {
		return profile;
	}

	/**
	 * @return the createTime
	 */
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * @return the startup
	 */
	public Startup getStartup() {
		return startup;
	}
	
	/**
	 * @return the investor
	 */
	public Investor getInvestor() {
		return investor;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @param content the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @param profile
	 */
	public void setProfile(Profile profile) {
		this.profile = profile;
	}

	/**
	 * @param createTime the createTime to set
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * @param startup the startup to set
	 */
	public void setStartup(Startup startup) {
		this.startup = startup;
	}
	
	/**
	 * @param investor the investor to set
	 */
	public void setInvestor(Investor investor) {
		this.investor = investor;
	}

}
